export default ({
  namespaced: true,
  state: {
    user: JSON.parse(localStorage.getItem('user')) || {},
  },
  getters: {
  },
  mutations: {
    loginMutation(state, data) {
      // console.log(data);
      state.user = data
    }
  },
  actions: {
    loginAtion({ commit }, data) {
      // console.log('sssssssssssss', data.driver);
      data.driver.driverScore = Number(data.driverScore)
      data.driver.goodComment = data.goodComment
      data.driver.orderNum = data.orderNum
      commit("loginMutation", data.driver);
      // console.log('aaaaaaaaaaa', data.driver);
      localStorage.setItem("user", JSON.stringify(data.driver))
      // console.log(JSON.parse(localStorage.getItem("user")));
    }
  },
  modules: {
  }
})
